package com.ruoyi.jjyh.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.jjyh.mapper.JjyhMemberlevelMapper;
import com.ruoyi.jjyh.domain.JjyhMemberlevel;
import com.ruoyi.jjyh.service.IJjyhMemberlevelService;
import com.ruoyi.common.core.text.Convert;

/**
 * 会员级别Service业务层处理
 * 
 * @author ruoyi
 * @date 2020-11-19
 */
@Service
public class JjyhMemberlevelServiceImpl implements IJjyhMemberlevelService 
{
    @Autowired
    private JjyhMemberlevelMapper jjyhMemberlevelMapper;

    /**
     * 查询会员级别
     * 
     * @param id 会员级别ID
     * @return 会员级别
     */
    @Override
    public JjyhMemberlevel selectJjyhMemberlevelById(String id)
    {
        return jjyhMemberlevelMapper.selectJjyhMemberlevelById(id);
    }

    /**
     * 查询会员级别列表
     * 
     * @param jjyhMemberlevel 会员级别
     * @return 会员级别
     */
    @Override
    public List<JjyhMemberlevel> selectJjyhMemberlevelList(JjyhMemberlevel jjyhMemberlevel)
    {
        return jjyhMemberlevelMapper.selectJjyhMemberlevelList(jjyhMemberlevel);
    }

    /**
     * 新增会员级别
     * 
     * @param jjyhMemberlevel 会员级别
     * @return 结果
     */
    @Override
    public int insertJjyhMemberlevel(JjyhMemberlevel jjyhMemberlevel)
    {
        jjyhMemberlevel.setCreateTime(DateUtils.getNowDate());
        return jjyhMemberlevelMapper.insertJjyhMemberlevel(jjyhMemberlevel);
    }

    /**
     * 修改会员级别
     * 
     * @param jjyhMemberlevel 会员级别
     * @return 结果
     */
    @Override
    public int updateJjyhMemberlevel(JjyhMemberlevel jjyhMemberlevel)
    {
        jjyhMemberlevel.setUpdateTime(DateUtils.getNowDate());
        return jjyhMemberlevelMapper.updateJjyhMemberlevel(jjyhMemberlevel);
    }

    /**
     * 删除会员级别对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteJjyhMemberlevelByIds(String ids)
    {
        return jjyhMemberlevelMapper.deleteJjyhMemberlevelByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除会员级别信息
     * 
     * @param id 会员级别ID
     * @return 结果
     */
    @Override
    public int deleteJjyhMemberlevelById(String id)
    {
        return jjyhMemberlevelMapper.deleteJjyhMemberlevelById(id);
    }
}
